Content-type: text/html; charset=UTF-8

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of REFIND-MKDEFAULT</TITLE>
</HEAD><BODY>
<H1>REFIND-MKDEFAULT</H1>
Section: rEFInd Manual (8)<BR>Updated: 0.11.4<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>

<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>

refind-mkdefault - Set rEFInd as the default EFI boot option
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>

<B>refind-mkdefault </B>

[ -L|--label &lt;name&gt; ]
<P>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>

<P>
EFI booting normally relies on boot manager entries stored in NVRAM, which
describe the locations of EFI boot programs and the order in which the
firmware will attempt to launch them. In Linux, these entries can be
created, deleted, and manipulated with the <I>efibootmgr</I> utility.
<P>
Many OSes and Linux packages assume that they should control the boot
process, and so both create NVRAM boot entries for themselves and set these
entries first in the boot order. If you intend rEFInd to control the boot
process, though, such changes are undesirable and require adjustment via
<I>efibootmgr</I>. Such adjustments are annoying to make and can be
intimidating to non-experts.
<P>
The <I>refind-mkdefault</I> script simplifies matters: Running this script
with no options sets rEFInd as the default boot program. The details of what
the script does depends on the current state of the boot order list and
existing boot entries:
<P>
<DL COMPACT>
<DT><B>*</B>

<DD>
If a rEFInd entry already exists in the boot order and is already first
in the list, no changes are made.
<P>
<DT><B>*</B>

<DD>
If a rEFInd entry already exists in the boot order but is not first in
the list, that entry is moved to the first position in the boot order.
<P>
<DT><B>*</B>

<DD>
If more than one rEFInd entry exists in the boot order,
<I>refind-mkdefault</I> moves the one that comes earliest to the front of the
boot order list.
<P>
<DT><B>*</B>

<DD>
If no rEFInd entry exists in the boot order but a rEFInd boot entry
can be found in the list of <B>Boot####</B> entries, it is added to the boot
order and placed at the front of the list.
<P>
<DT><B>*</B>

<DD>
If multiple rEFInd boot entries exist but none is in the boot order, all the
entries are added to the boot order, but which one is first is uncontrolled.
<P>
</DL>
<P>

<P>
A rEFInd entry is defined as one that contains the string <B>refind</B>
(case-insensitive). This string could exist in the description or in the
filename. The string used to define the rEFInd entry can be changed via the
<I>--label</I> (<I>-L</I>) option.
<P>
The intent is that <I>refind-mkdefault</I> can be called after booting via
GRUB or some other means to restore rEFInd as the default boot program.  It
can also be placed in a startup and/or shutdown script to restore rEFInd to
its default position automatically. Because it does not re-write the boot
order if rEFInd is listed as the first boot entry, this practice should be
low in risk.
<P>
<A NAME="lbAE">&nbsp;</A>
<H2>OPTIONS</H2>

<P>
<DL COMPACT>
<DT><B>-L | --label </B><I>&lt;name&gt;</I>

<DD>
Instead of searching for the string <B>refind</B> in <I>efibootmgr</I> output
as a way to identify rEFInd, search for the string <B>name</B>.
<P>
</DL>
<A NAME="lbAF">&nbsp;</A>
<H2>RETURN VALUES</H2>

<P>
<I>refind-mkdefault</I> returns the following values:
<P>
<DL COMPACT>
<DT><B>0</B>

<DD>
The script completed successfully, which can mean either that no change was
necessary or that the call to <I>efibootmgr</I> returned a success code.
<P>
<DT><B>1</B>

<DD>
EFI boot order variables are available, and a rEFInd entry was found, but
the call to <I>efibootmgr</I> returned a failure code.
<P>
<DT><B>2</B>

<DD>
EFI boot entries are not available. This condition is often an indication of
a buggy EFI or badly damaged NVRAM contents.
<P>
<DT><B>3</B>

<DD>
No rEFInd entry could be found in the list of boot options, and so
no changes were made to the boot order list.
<P>
<DT><B>4</B>

<DD>
The script could not run because of OS issues -- the OS was not Linux,
the <I>efibootmgr</I> utility was not available, or the script was not run
as <I>root</I>.
<P>
</DL>
<A NAME="lbAG">&nbsp;</A>
<H2>LIMITATIONS</H2>

<P>
<DL COMPACT>
<DT><B>*</B>

<DD>
<I>refind-mkdefault</I> does not work when booted in BIOS mode (including
via a Compatibility Support Module, or CSM, on an EFI-based computer).
Similarly, it does not work if <I>efibootmgr</I> is not installed or fails
to work for any reason.
<P>
<DT><B>*</B>

<DD>
The script uses a very simple algorithm to determine what to move to
the start of the boot order list. This algorithm may fail if the system
has redundant or non-functional rEFInd boot entries or if those entries
are not named in an expected fashion. Cleaning up the boot entries by
manual use of <I>efibootmgr</I> may be necessary in such cases.
<P>
</DL>
<A NAME="lbAH">&nbsp;</A>
<H2>AUTHORS</H2>

Primary author: Roderick W. Smith (<A HREF="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</A>)
<P>
<A NAME="lbAI">&nbsp;</A>
<H2>SEE ALSO</H2>

<B>mvrefind (8)</B>,
<B>mkrlconf (8)</B>,
<B>refind-install (8)</B>,
<B>efibootmgr (8)</B>
<P>
<I><A HREF="http://www.rodsbooks.com/refind/">http://www.rodsbooks.com/refind/</A></I>
<P>
<A NAME="lbAJ">&nbsp;</A>
<H2>AVAILABILITY</H2>

The <B>refind-mkdefault</B> command is part of the <I>rEFInd</I> package and is
available from Roderick W. Smith.
<P>

<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT><A HREF="#lbAB">NAME</A><DD>
<DT><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT><A HREF="#lbAE">OPTIONS</A><DD>
<DT><A HREF="#lbAF">RETURN VALUES</A><DD>
<DT><A HREF="#lbAG">LIMITATIONS</A><DD>
<DT><A HREF="#lbAH">AUTHORS</A><DD>
<DT><A HREF="#lbAI">SEE ALSO</A><DD>
<DT><A HREF="#lbAJ">AVAILABILITY</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 20:12:13 GMT, November 12, 2018
</BODY>
</HTML>
